﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AUV5.BLL
{
    public class BaseBLL
    {
        public BaseBLL() { 
            
        }

        public IBatisNet.DataMapper.ISqlMapper SqlMap = new DAL.BaseSqlMapDao().Mapper;

        /// <summary>
        /// 获取的图片的缩略图路径
        /// </summary>
        /// <param name="imgPath"></param>
        /// <returns></returns>
        public string GetImageThumb(string imgPath)
        {
            if (imgPath != "" && imgPath.IndexOf('.') != -1)
            {
                imgPath = imgPath.Replace(imgPath.Substring(imgPath.LastIndexOf('.'), imgPath.Length - imgPath.LastIndexOf('.')), "_thumb.jpg");
            }
            return imgPath;
        }
        /// <summary>
        /// 获取图片的预览图路径
        /// </summary>
        /// <param name="imgPath"></param>
        /// <returns></returns>
        public string GetImagePreview(string imgPath)
        {
            if (imgPath != "" && imgPath.IndexOf('.') != -1)
            {
                imgPath = imgPath.Replace(imgPath.Substring(imgPath.LastIndexOf('.'), imgPath.Length - imgPath.LastIndexOf('.')), "_preview.jpg");
            }
            return imgPath;
        }
    }
}
